<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<title>推广链接</title>
		<%@include file="/WEB-INF/base.jspf"%>
		<style>
		 body {
		 	padding:30px;
		 }
		 .div-c-searchTool {
		 	display:flex;
		 	align-items:center;
		 }
		 .div-c-searchTool input[type='date'].form-control {
		 	width:150px;
		 }
		 .div-c-searchTool select.form-control {
		 	width:140px;
		 }
		 .div-c-searchTool input[type='text'].form-control {
		 	width:160px;
		 }
		 .div-c-searchTool * {
		 	margin-right:6px;
		 }
		 .div-c-searchTool {
		 	margin-bottom:10px;
		 }
		 span.btn {
		 	cursor: default;
		 }
 table th, table tr, table td {
	text-align: center;
	vertical-align: middle;
}
		</style>
	</head>
	<body style="">
<div class="div-c-main">
		<div class="div-c-searchTool">
			<button class="btn btn-default">推广链接</button>
		</div>
<table id="table-i-subLevelList" class="table-normal-datatables table table-striped table-bordered table-hover">
		<thead>
			<tr>
				<th>编号</th>
				<th>代理账号</th>
				<th>推广链接</th>
				<th>状态</th>
				<th style="display: none;"></th>
			</tr>
		</thead>
		<tbody>
		</tbody>
	</table>		
	</div>

<!-- 提醒模态框（Modal） -->

<div class="modal fade" id="noticeModal" tabindex="-1" role="dialog" aria-labelledby="noticeModal" aria-hidden="true">
    <div class="modal-dialog class-fake-alert">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            </div>
            <div class="modal-body" ></div>
            <div class="modal-footer">	      
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>		
					
	</body>
	<script type="text/javascript" src="/js/zhengzeTools.js"></script>
	<script>
	//initAllTable()
  	var state = "启用"
	var dataTable = $("#table-i-subLevelList").DataTable({
		      // "bPaginate": true,
		      "bLengthChange": true,      
		      "bSort": false,
		      "bAutoWidth": false,
		      'aLengthMenu':[10, 20],
		       "searching": false,
		       "dom": `ftp`,
		       "language": {//语言设置  
		            "lengthMenu": "每页显示 _MENU_ 条记录",     
		            "zeroRecords": "没有检索到数据",     
		            "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",     
		            "info": "没有数据",     
		            "oPaginate": {     
		                "sFirst": "首页",     
		                "sPrevious": "前一页",     
		                "sNext": "后一页",     
		                "sLast": "尾页"    
		          	},
		            "search":"搜索:",
		            "infoFiltered":   "(从  _MAX_ 记录中搜索出结果)",
		            "infoEmpty":      "没有找到匹配的信息",
		         },
		         "ajax": {
		        	 "type": "POST",
		        	 "url": "/userAgent/extensionLink.do",
  		        	 "dataSrc": function(json) {
		        		 var newJson = json.data
		        		 if (newJson == "未检索到信息") {
		        			 return []
		        		 }
		        		 
		        		 console.log(newJson[0].domain_status)
 		       			for(i = 0; i < newJson.length; i++) {
		         			 var item = newJson[i]
		         			 if(item.domain_status==1){
		         				 item.domain_status="<span>启用</span>"
		         			 }else{
		         				item.domain_status="<span>禁用</span>"
		         			 }
		         			 
		         			 item.indexValue = i + 1
		         			 var money = Number(item.deposit) * Number(item.rebateRate)
		         			 item.fandianMoney = Math.round(money * 100) / 100
		        		 } 
		        		 return newJson
		        	 }, 
		         },
   		         "columns": [
							 {"data": "indexValue",},
		                     {"data": "default_agency",},
		                     {"data": "domain",},
		                     {"data": "domain_status"},
		                     { "data": "id", "className": "td-c-id hidden-td"},
		                 ] 
		   		 })
	</script>
</html>
